const config = require("../config")
module.exports = async (ctx, next) => {
  // 将config注入到ctx，方便在任意handler获取config
  ctx.config = config
  ctx.rest = (data, code = 200) => {
    ctx.body = {
      code,
      data,
      msg: ""
    }
  }
  await next()
}
